package jwdt.xadmin.goods.service.impl;

import jwdt.common.dao.BaseDao;
import jwdt.xadmin.goods.bean.TMeeting;
import jwdt.xadmin.goods.service.MeetingManageSerivce;

import com.ezerg.db.ext.PageUtil;

public class MeetingManageServiceImpl implements MeetingManageSerivce {
	
	private BaseDao<TMeeting> baseDao;

	public void setBaseDao(BaseDao<TMeeting> baseDao) {
		this.baseDao = baseDao;
	}
	
	@Override
	public PageUtil selectMeetingList(PageUtil pu)throws Exception{
		pu.doList(TMeeting.class);
		return pu;
	}
	
	@Override
	public TMeeting selectOneMeeting(int meetingid)throws Exception{
		return baseDao.doLoadObj(TMeeting.class, meetingid);
	}
	
	@Override
	public String saveMeeting(int meetingid,TMeeting obj)throws Exception{
		if(meetingid==0){
			return baseDao.doAddObj(obj);
		}
		return baseDao.doUpdateObj(TMeeting.class, meetingid, obj);
	}
	
	@Override
	public String delMeetingRoom(int meetingid)throws Exception{
		return baseDao.doDelObj(TMeeting.class, meetingid);
	}
	
	@Override
	public String meetingChkact(int useid,int zt)throws Exception{
		return baseDao.doIntUpdateState(TMeeting.class, "meetingid="+useid, "zt="+zt);
	}
	
}
